package io.gitee.tziye.enums;

public enum SearchType {

    natural,

    bool_match,
    bool_must,
    bool_mustNot,
    bool_startWith,
    bool_lower,

    expansion;

    public static String mode(SearchType type) {
        return switch (type) {
            case natural -> "IN NATURAL LANGUAGE MODE";
            case bool_match, bool_must, bool_mustNot, bool_startWith, bool_lower -> "IN BOOLEAN MODE";
            case expansion -> "WITH QUERY EXPANSION";
        };
    }

    public static String symbol(SearchType type) {
        return switch (type) {
            case natural, expansion, bool_match -> "";
            case bool_must -> "+";
            case bool_mustNot -> "-";
            case bool_startWith -> "*";
            case bool_lower -> "~";
        };
    }
}
